package com.mvvm.store.ui.delivery;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.LiveData;

import com.mvvm.store.base.BaseViewModel;
import com.mvvm.store.base.RepositoryImpl;
import com.mvvm.store.bean.DeliveryParasBean;
import com.mvvm.store.bean.StockUpParasBean;
import com.mvvm.store.bean.basebean.DeliveryGetListResultBean;
import com.mvvm.store.bean.basebean.DeliveryResultBean;
import com.mvvm.store.bean.basebean.DeliverySubmitParams;
import com.mvvm.store.bean.basebean.IntoSubmitPramsBean;
import com.mvvm.store.bean.basebean.ParamsBuilder;
import com.mvvm.store.bean.basebean.Resource;
import com.mvvm.store.bean.basebean.ResponModel;
import com.mvvm.store.bean.basebean.StockUpGetListResultBean;
import com.mvvm.store.bean.basebean.StockUpResultBean;
import com.mvvm.store.bean.basebean.UserAuthenticationBean;

import java.util.List;

/**
 * Created by leo
 * on 2019/10/16.
 * 入库请求
 * 从每个页面的ViewModel里，就能看出每个页面的功能和联网请求。类似于MVP里的契约类
 */
public class DeliveryViewModel extends BaseViewModel<RepositoryImpl> {


    public DeliveryViewModel(@NonNull Application application) {
        super(application);
    }


    //获取出货列表数据
    public LiveData<Resource<DeliveryResultBean>> getDeliveryList(DeliveryParasBean deliveryParasBean, ParamsBuilder paramsBuilder) {
        return getRepository().getDeliveryList(deliveryParasBean, paramsBuilder);
    }


    //获取出货零件列表数据
    public LiveData<Resource<DeliveryGetListResultBean>> getDeliveryDetailsList(String id) {
        return getRepository().getDeliveryDetailsList(id);
    }

    //出库提交  deliverySubmit
    public LiveData<Resource<ResponModel>> deliverySubmit(DeliverySubmitParams submitParams){
        return  getRepository().deliverySubmit(submitParams);
    }

    //用户验证 userAuthentication
    public LiveData<Resource<String>> userAuthentication(UserAuthenticationBean userAuthenticationBean){
        return  getRepository().userAuthentication(userAuthenticationBean);
    }


}
